-
Notifications
You must be signed in to change notification settings - Fork 815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor beta blocks registration #32815
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Jetpack plugin:
|
cbf833a
to
8a05697
Compare
79e58f0
to
d86c784
Compare
ff71727
to
b058f18
Compare
615d323
to
133828b
Compare
* [not verified] Enable block registration by specifying block.json path * [not verified] Add test for registering block by its metadata file * [not verified] Fix failing test * [not verified] Refactor: register business hours block with block.json path * [not verified] Move logic to render a block icon on the client * [not verified] Remove deprecated file * [not verified] Pass package build dir to get_path_to_block_metadata * [not verified] Move block icon helpers to shared-extension-utils package * [not verified] Add missing color-studio dependency to shared-extension-utils * [not verified] Add missing jetpack-constants dep to blocks package * [not verified] Fix monorepo package version refs * [not verified] Remove color studio dep in shared-extensions-util * [not verified] Bump yoast/phpunit-polyfills version in blocks package * [not verified] Remove unhelpful changelogs * [not verified] Add missing color-studio dependency to shared-extension-utils * [not verified] Add tests for blocks helpers functions * [not verified] Refactor Amazon block registration * [not verified] Refactor AI Chat block registration * [not verified] Refactor Blogroll block registration * [not verified] Refactor Recipe block registration * [not verified] Refactor Create with Voice block registration * [not verified] Fix missing imports in Recipe child blocks * [not verified] Refactor Docs blocks registration * [not verified] Fix Amazon icon * [not verified] Use CSS logical properties for i18n * [not verified] Fix Recipe block not correctly displayed in inserter * [not verified] Fix Amazon icon alignment * [not verified] Fix rebasing error * [not verified] Update path passed to jetpack_register_block * [not verified] Import icon helpers from shared-extension-utils package * [not verified] Update path passed to jetpack_register_block * [not verified] Add changelog * [not verified] Fix failing JS test * [not verified] Add helper to get block's feature name * [not verified] Add changelog * [not verified] Remove color studio dep * [not verified] Add helper to get a block's name * [not verified] Remove deprecated CSS * [not verified] Add missing Blocks::get_block_feature call * [not verified] Remove unnecessary export * [not verified] Fix Google embeds previews * Revert composer.lock
See #32602
Proposed changes:
Registers the beta blocks (AI Chat, Amazon, Blogroll, Google Docs Embed, Recipe, Create with Voice) by specifying the path to their block.json file. This was made possible by #32697. The goal is to avoid the duplication of block metadata and use block.json as the source of truth.
In more details:
registerJetpackBlockFromMetadata
to redeclare variations icons on the client.editorScript
property fromblock.json
(automatically added during the build)icon
property ofblock.json
icon.js
shared-extension-utils
packageblock.json
index.js
toblock.json
andeditor.js
and delete the fileattributes.js
toblock.json
and delete the fileOther information:
Jetpack product discussion
pedMtX-RS-p2
Does this pull request change what data or activity we track or use?
No.
Testing instructions:
define( 'JETPACK_BLOCKS_VARIATION', 'beta' );
to yourwp-config.php
otherwise.trunk
(some newer ones, such as Blogroll, might not be functional yet). This PR shouldn't change anything from a user's standpoint.A couple of notes: